package ro.peoplecentric.ctc.common.service;

import java.util.List;

import ro.peoplecentric.ctc.common.entity.Region;
import ro.peoplecentric.ctc.common.exception.ApplicationException;

/**
 * Service for Region CRUD.
 *
 * @author pguzun
 */
public interface RegionService {

    /**
     * Saves the {@link Region} to DB. If the provided {@link Region} object was already associated with the persistent context, the entity's state will be
     * updated.
     *
     * @param region the {@link Region} to save
     * @throws ApplicationException in case of DAO exception
     */
    void saveRegion(Region region) throws ApplicationException;

    /**
     * Deletes an existing {@link Region} from the data store.
     *
     * @param region the <strong>persistent</strong> {@link Region} to delete
     * @throws ApplicationException in case of DAO exception
     */
    void deleteRegion(Region currentObject) throws ApplicationException;

    /**
     * Gets all the {@link Region}s from DB.
     *
     * @return a list of {@link Region}s
     * @throws ApplicationException in case of DAO exception
     */
    List<Region> getAll() throws ApplicationException;

    /**
	 * Get {@link Region} by id.
	 * 
	 * @param id
	 *            the region ID
	 * @return the found {@link Region} entity or null if not found.
	 */
	Region getById(Long id) throws ApplicationException;
}
